package com.gwnet.shop.enums;


/**
 * 订单状态(0待付款 1待接单 2待到店 3待取货 4待送达 5 待收货 6 完成 7取消(客户)8作废(管理员))9已退款
 * @author: WangLiang
 * @date: 2024/8/1 8:29
 */
public enum OrderStatusEnum {

    WAIT_PAY("0","待付款"),

    WAIT_RECEIVE_ORDER("1","待接单"),
    WAIT_TO_STORE("2","待到店"),
    WAIT_PICK_UP("3","待取货"),
    WAIT_DELIVERY("4","待送达"),
    WAIT_TAKE_DEV("5","待收货"),
    SUCCESS("6","完成"),
    CANCEL("7","取消"),
    ABANDON("8","作废"),
    REFUND("9","退款"),

    ;


    private String code;
    private String desc;

    OrderStatusEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    public static OrderStatusEnum instance(String value) {
        OrderStatusEnum[] enums = values();
        for (OrderStatusEnum statusEnum : enums) {
            if (statusEnum.code().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }
}
